<?php

/*

  Action	$2

  Choose two: +1 Card; +1 Action; +1 Buy; +$1.
  (The choices must be different.)

 */

class Pawn extends Card implements iAction, iKingdom, iIntrigue {

    public function __construct() {
        parent::__construct("Pawn", 2);
        $this->undoPlay = false;
        $this->undoBuy = true;
    }

    public function getDescription() {
        return array(
            "Choose two: +1 Card; +1 Action; +1 Buy; +$1. (The choices must be different.)");
    }
    
    public function play(Game $game, $isRealCard) {
        $options = array(new Option(1, "1 Card"), new Option(2, "1 Action"), new Option(2, "1 Buy"), new Option(2, "1$"));
        
        $output = MySocket::GetUserReply($game, Input_ChooseMany, $options, 2, 2, null, "Please choose any two");
        foreach ($output as $answer) {
            if ($answer == "1 Action") {
                $game->addActions(1);
                 ScreenDisplay::addScreenMessage($game, true, "get +1 action", "gets +1 action");
            } elseif ($answer == "1 Card") {
                $drawed_cards = $game->drawCards(1);
                 ScreenDisplay::addScreenMessage($game, true, "draw ".  nicePrint($drawed_cards), "draws ".sizeof($drawed_cards). " cards");
            } elseif ($answer == "1 Buy") {
                $game->addBuys(1);
                 ScreenDisplay::addScreenMessage($game, true, "get +1 buy", "gets +1 buy");
            } else {
                $game->addMoney(new Price(1));
                 ScreenDisplay::addScreenMessage($game, true, "get +1$", "gets +1$");
            }
        }

        $game->cardActionFinished();
        return true;
    }

}

?>